package io;

import java.io.FileReader;
import java.io.Reader;

public class demo10 {
    public static void main(String[] args) {
        try(Reader reader = new FileReader("./text.txt")){
            while (true) {
                // int ch = reader.read();
                // if (ch == -1) {
                //     break;
                // }
                // char c = (char) ch;
                // System.out.println(c);

                char[] chars = new char[1024];
                int n = reader.read(chars);
                if (n == -1) {
                    break;
                }
                for (int i = 0; i < n; i++) {
                    System.out.println(chars[i]);
                }
            }
        }catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }
    }
}
